
package com.jiuzhe.commercial.ui.components;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;


public class EQGridItemView extends LinearLayout implements EQGirdListViewBase.EQGirdScrollableListItem
{
	public LinearLayout fixLinearLayout;
	public LinearLayout otherLinearLayout;
	private int nTotalWidth;
	
	public EQGridItemView(Context context) {
		super(context);
		fixLinearLayout = new LinearLayout(context);
		otherLinearLayout = new LinearLayout(context);
		addView(fixLinearLayout);
		addView(otherLinearLayout);
	}
	
	public EQGridItemView(Context context, AttributeSet attrs) {
		super(context, attrs);

		fixLinearLayout = new LinearLayout(context);
		otherLinearLayout = new LinearLayout(context);
		addView(fixLinearLayout);
		addView(otherLinearLayout);
	}

	public void DoPaint() {
		
	}
	
	public void setTotalWidth(int nWidth) {
		nTotalWidth = nWidth;
	}
		
	@Override
	public int getColumnWidth() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int getColumnCount() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int getFixCount() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int getScrollColumnCount() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int availableToScroll() {
		return (int) (nTotalWidth - otherLinearLayout.getWidth() - otherLinearLayout.getScrollX());
	}

	@Override
	public int totalToScroll() {
        int totalToScroll = 0;
        if (otherLinearLayout != null) {
            totalToScroll = nTotalWidth - otherLinearLayout.getWidth();
        }
        return totalToScroll < 0 ? 0 : totalToScroll;
	}

	@Override
	public View getScrollableView() {
		// TODO Auto-generated method stub
		return otherLinearLayout;
	}

	@Override
	public boolean isCanScrollAble() {
		// TODO Auto-generated method stub
		return false;
	}		
}
